blob: 8994c6d4344344293453684a1e811b56819d3c81 [file] [log] [blame]
Junio C Hamano58256872007-12-04 08:31:131git-help(1)
2===========
3
4NAME
5----
6git-help - display help information about git
7
8SYNOPSIS
9--------
Junio C Hamano3dac5042007-12-15 08:40:5410'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND]
Junio C Hamano58256872007-12-04 08:31:1311
12DESCRIPTION
13-----------
14
15With no options and no COMMAND given, the synopsis of the 'git'
16command and a list of the most commonly used git commands are printed
17on the standard output.
18
19If the option '--all' or '-a' is given, then all available commands are
20printed on the standard output.
21
22If a git command is named, a manual page for that command is brought
Junio C Hamano0c0da5f2007-12-13 02:45:3023up. The 'man' program is used by default for this purpose, but this
Junio C Hamanofe986052007-12-19 07:33:3824can be overridden by other options or configuration variables.
Junio C Hamano58256872007-12-04 08:31:1325
26Note that 'git --help ...' is identical as 'git help ...' because the
27former is internally converted into the latter.
28
29OPTIONS
30-------
31-a|--all::
Junio C Hamano58256872007-12-04 08:31:1332Prints all the available commands on the standard output. This
Junio C Hamanofe986052007-12-19 07:33:3833option supersedes any other option.
Junio C Hamano58256872007-12-04 08:31:1334
Junio C Hamano0c0da5f2007-12-13 02:45:3035-i|--info::
Junio C Hamano8b588d52008-03-15 09:48:3736Display manual page for the command in the 'info' format. The
37'info' program will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3038
Junio C Hamano3dac5042007-12-15 08:40:5439-m|--man::
Junio C Hamano8b588d52008-03-15 09:48:3740Display manual page for the command in the 'man' format. This
41option may be used to override a value set in the
42'help.format' configuration variable.
43+
44By default the 'man' program will be used to display the manual page,
45but the 'man.viewer' configuration variable may be used to choose
46other display programs (see below).
Junio C Hamano3dac5042007-12-15 08:40:5447
Junio C Hamano0c0da5f2007-12-13 02:45:3048-w|--web::
Junio C Hamano8b588d52008-03-15 09:48:3749Display manual page for the command in the 'web' (HTML)
50format. A web browser will be used for that purpose.
Junio C Hamano0c0da5f2007-12-13 02:45:3051+
52The web browser can be specified using the configuration variable
53'help.browser', or 'web.browser' if the former is not set. If none of
Junio C Hamano26e590a2008-02-17 03:53:5154these config variables is set, the 'git-web--browse' helper script
55(called by 'git-help') will pick a suitable default. See
56linkgit:git-web--browse[1] for more information about this.
Junio C Hamano0c0da5f2007-12-13 02:45:3057
Junio C Hamano3dac5042007-12-15 08:40:5458CONFIGURATION VARIABLES
59-----------------------
60
Junio C Hamano8b588d52008-03-15 09:48:3761help.format
62~~~~~~~~~~~
63
Junio C Hamano3dac5042007-12-15 08:40:5464If no command line option is passed, the 'help.format' configuration
65variable will be checked. The following values are supported for this
66variable; they make 'git-help' behave as their corresponding command
67line option:
68
69* "man" corresponds to '-m|--man',
70* "info" corresponds to '-i|--info',
Junio C Hamano8b588d52008-03-15 09:48:3771* "web" or "html" correspond to '-w|--web'.
72
73help.browser, web.browser and browser.<tool>.path
74~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano3dac5042007-12-15 08:40:5475
76The 'help.browser', 'web.browser' and 'browser.<tool>.path' will also
Junio C Hamanofe986052007-12-19 07:33:3877be checked if the 'web' format is chosen (either by command line
Junio C Hamano3dac5042007-12-15 08:40:5478option or configuration variable). See '-w|--web' in the OPTIONS
Junio C Hamano26e590a2008-02-17 03:53:5179section above and linkgit:git-web--browse[1].
Junio C Hamano3dac5042007-12-15 08:40:5480
Junio C Hamano8b588d52008-03-15 09:48:3781man.viewer
82~~~~~~~~~~
83
84The 'man.viewer' config variable will be checked if the 'man' format
Junio C Hamano6d76d612008-05-09 05:46:0885is chosen. The following values are currently supported:
Junio C Hamano8b588d52008-03-15 09:48:3786
87* "man": use the 'man' program as usual,
88* "woman": use 'emacsclient' to launch the "woman" mode in emacs
89(this only works starting with emacsclient versions 22),
Junio C Hamano6d76d612008-05-09 05:46:0890* "konqueror": use 'kfmclient' to open the man page in a new konqueror
91tab (see 'Note about konqueror' below).
Junio C Hamano8b588d52008-03-15 09:48:3792
Junio C Hamano6d76d612008-05-09 05:46:0893Values for other tools can be used if there is a corresponding
94'man.<tool>.cmd' configuration entry (see below).
95
96Multiple values may be given to the 'man.viewer' configuration
97variable. Their corresponding programs will be tried in the order
98listed in the configuration file.
Junio C Hamano8b588d52008-03-15 09:48:3799
100For example, this configuration:
101
Junio C Hamano6d76d612008-05-09 05:46:08102------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37103[man]
104viewer = konqueror
105viewer = woman
Junio C Hamano6d76d612008-05-09 05:46:08106------------------------------------------------
Junio C Hamano8b588d52008-03-15 09:48:37107
108will try to use konqueror first. But this may fail (for example if
109DISPLAY is not set) and in that case emacs' woman mode will be tried.
110
111If everything fails the 'man' program will be tried anyway.
112
Junio C Hamano6d76d612008-05-09 05:46:08113man.<tool>.path
114~~~~~~~~~~~~~~~
115
116You can explicitly provide a full path to your preferred man viewer by
117setting the configuration variable 'man.<tool>.path'. For example, you
118can configure the absolute path to konqueror by setting
119'man.konqueror.path'. Otherwise, 'git help' assumes the tool is
120available in PATH.
121
122man.<tool>.cmd
123~~~~~~~~~~~~~~
124
125When the man viewer, specified by the 'man.viewer' configuration
126variables, is not among the supported ones, then the corresponding
127'man.<tool>.cmd' configuration variable will be looked up. If this
128variable exists then the specified tool will be treated as a custom
129command and a shell eval will be used to run the command with the man
130page passed as arguments.
131
132Note about konqueror
133~~~~~~~~~~~~~~~~~~~~
134
135When 'konqueror' is specified in the 'man.viewer' configuration
136variable, we launch 'kfmclient' to try to open the man page on an
137already opened konqueror in a new tab if possible.
138
139For consistency, we also try such a trick if 'man.konqueror.path' is
140set to something like 'A_PATH_TO/konqueror'. That means we will try to
141launch 'A_PATH_TO/kfmclient' instead.
142
143If you really want to use 'konqueror', then you can use something like
144the following:
145
146------------------------------------------------
147[man]
148viewer = konq
149
150[man "konq"]
151cmd = A_PATH_TO/konqueror
152------------------------------------------------
153
Junio C Hamano8b588d52008-03-15 09:48:37154Note about git config --global
155~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156
157Note that all these configuration variables should probably be set
158using the '--global' flag, for example like this:
Junio C Hamano3dac5042007-12-15 08:40:54159
160------------------------------------------------
161$ git config --global help.format web
162$ git config --global web.browser firefox
163------------------------------------------------
164
165as they are probably more user specific than repository specific.
Junio C Hamano35738e82008-01-07 07:55:46166See linkgit:git-config[1] for more information about this.
Junio C Hamano3dac5042007-12-15 08:40:54167
Junio C Hamano58256872007-12-04 08:31:13168Author
169------
170Written by Junio C Hamano <gitster@pobox.com> and the git-list
171<git@vger.kernel.org>.
172
173Documentation
174-------------
Junio C Hamanof7c042d2008-06-06 22:50:53175Initial documentation was part of the linkgit:git[1] man page.
Junio C Hamano58256872007-12-04 08:31:13176Christian Couder <chriscool@tuxfamily.org> extracted and rewrote it a
177little. Maintenance is done by the git-list <git@vger.kernel.org>.
178
179GIT
180---
Junio C Hamanof7c042d2008-06-06 22:50:53181Part of the linkgit:git[1] suite